package homework02.exercise1;

public class View {

    private int year;
    private int month;
    private int day;

    public View(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void tomorrow(int year, int month, int day) {


        Date date = new Date(year, month, day);
        switch (month) {
            case 1:
                date.JudgeBigMonth(year, month, day);
                break;
            case 2:
                date.JudgeFebuary(year, month, day);
                break;
            case 3:
                date.JudgeBigMonth(year, month, day);
                break;
            case 4:
                date.JudgeSmallMonth(year, month, day);
                break;
            case 5:
                date.JudgeBigMonth(year, month, day);
                break;
            case 6:
                date.JudgeSmallMonth(year, month, day);
                break;
            case 7:
                date.JudgeBigMonth(year, month, day);
                break;
            case 8:
                date.JudgeBigMonth(year, month, day);
                break;
            case 9:
                date.JudgeSmallMonth(year, month, day);
                break;
            case 10:
                date.JudgeBigMonth(year, month, day);
                break;
            case 11:
                date.JudgeSmallMonth(year, month, day);
                break;
            case 12:
                date.JudgeBigMonth(year, month, day);
                break;
        }
        System.out.println("明天日期为: "+date);
    }

    public void daysInMonth(int year,int month) {//月内天数

        if (month==4 || month==6 || month==9 || month==11) {
            day = 30;
            //判断大月
        } else if (month!=2) {
            day = 31;
            //2月
        } else {
            if((year%4==0 && year%100!=0) || year%400==0) {//29天
                day = 29;
            } else {
                day = 28;
            }
        }
        System.out.println("本月的天数为: "+day);
    }

}


